{% extends "WebMainSiteBundle:Course:layout.html.twig" %}
{% set title = "创建章节" %}
{% block title %}
    {{ title }}
{% endblock %}

{% block user_main %}

    <form class="form-horizontal" method="post" enctype="multipart/form-data">
        {% if app.request.get("id")  and entity.id is defined %}
            <input type="hidden" name="id" value="{{ app.request.get("id") }}" />
        {% endif %}
        <div class="row">
            <div class="col-md-8">
                <div class="form-group">
                    <div class="col-md-3 text-right"><label class="control-label" for="parent">章节所属:</label></div>
                    <div class="col-md-8">
                        <select name="parent"  class="form-control input-lg">
                            <option value="0">根目录</option>
                            {% for c in courseLessonArrange %}<option {% if entity["parent"] is defined and entity["parent"] == c.id %}selected="selected" {% endif %} value="{{ c.id }}">{{ c.name }}</option>{% endfor %}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3 text-right"><label class="control-label" for="title">章节标题:</label></div>
                    <div class="col-md-8">
                        <input
                                name="title"
                                id="title"
                                type="text"
                                class="form-control input-lg"
                                placeholder="请设置章节标题"
                                value="{% if entity.name is defined %}{{ entity.name }}{% endif %}"
                                />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3 text-right"><label class="control-label" for="orders">章节顺序:</label></div>
                    <div class="col-md-8">
                        <input
                                name="orders"
                                id="orders"
                                type="text"
                                class="form-control input-lg"
                                placeholder="请设置章节顺序"
                                value="{% if entity.orders is defined %}{{ entity.orders }}{% endif %}"
                                />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3 text-right"><label class="control-label" for="info">章节简介:</label></div>
                    <div class="col-md-8">
                        <textarea  name="info" class="form-control" rows="11" id="info" placeholder="章节简介">{% if entity.info is defined %}{{ entity.info }}{% endif %}</textarea>
                    </div>
                </div>
                <p class="buttons-margin-horizontal">
                    <input type="submit" class="btn btn-theme btn-green" value="提交" />
                </p>
            </div>
        </div>
    </form>

    {#<form method="post" enctype="multipart/form-data">#}
        {#&#123;&#35;{% if app.request.get("id")  and entity.id is defined %}&#35;&#125;#}
        {#&#123;&#35;<input type="hidden" name="id" value="{{ app.request.get("id") }}" />&#35;&#125;#}
        {#&#123;&#35;{% endif %}&#35;&#125;#}
        {#章节所属：<select name="parent">#}
            {#<option value="0">根目录</option>#}
            {#{% for c in courseLessonArrange %}<option {% if entity["parent"] is defined and entity["parent"] == c.id %}selected="selected" {% endif %} value="{{ c.id }}">{{ c.name }}</option>{% endfor %}#}
        {#</select>#}
        {#<br/>#}
        {#章节标题：<input type="text" name="title" value="{% if entity["name"] is defined %}{{ entity["name"] }}{% endif %}"/>#}
        {#<br/>#}
        {#章节顺序：<input type="text" name="orders" value="{% if entity["orders"] is defined %}{{ entity["orders"] }}{% endif %}"/>建议与章节标题中的顺序编号一致，由小到大向下排序#}
        {#<br/>#}
        {#章节简介：<textarea name="info" style="width: 300px;height: 160px;display: inline-block;">{% if entity["info"] is defined %}{{ entity["info"] }}{% endif %}</textarea>#}
        {#<br/>#}
        {#<input type="submit" />#}
    {#</form>#}
    {#{{ dump(course) }}#}
{% endblock %}